/*******************************************************************
This file is part of StartButton.

StartButton is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

StartButton is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with StartButton.  If not, see <http://www.gnu.org/licenses/>.

********************************************************************

StartButton is based on GreenButton by Doug Melton, available at 
http://www.supware.net/

StartButton info and bug reports:
allleimo@interfree.it
*******************************************************************/

// Setup.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "ce_setup.h"

codeINSTALL_EXIT Install_Exit( HWND    hwndParent,
                               LPCTSTR pszInstallDir,      // final install directory
                               WORD    cFailedDirs,
                               WORD    cFailedFiles,
                               WORD    cFailedRegKeys,
                               WORD    cFailedRegVals,
                               WORD    cFailedShortcuts) {

    TCHAR szExeName[MAX_PATH];
    PROCESS_INFORMATION pi;

    // After install, execute the program for the first time
    // (after this, it should be run automatically at 
    // boot b/c of the shortcut in \Windows\Startup)

    StringCchCopy(szExeName, MAX_PATH, pszInstallDir);
    StringCchCat(szExeName, MAX_PATH, TEXT("\\StartButton.exe"));

    // Debug message
    //MessageBox(hwndParent, szExeName, TEXT("Starting up..."), NULL);

    CreateProcess(szExeName, NULL,
        NULL, NULL, FALSE, NULL, NULL, NULL, NULL, &pi);

    return codeINSTALL_EXIT_DONE;
}
